
<div class="container report_page" >
    <div class="col-md-7 report">
    	<div class="">
    		<?php $objForm = $this->beginWidget('CActiveForm',  array('id' => 'SubmitForm')); ?>
	    		<p class="big_font">
	    			<span id="display_user"></span>
					您好，您举报"
					<a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl('/front/good/show', array('gid' => $goodModel->goods_id)); ?>"><?php echo $goodModel->goods_name ?></a>
					"的原因是:
				</p>
				<?php echo $objForm->error( $model, 'type' ); ?>
				<ul>
					<?php foreach(PunishModel::getTypeHtmlList() as $key => $value){ ?>
					<li>
						<input class="checkbox" type="checkbox"  value="<?php echo $key; ?>" name="type[]">
						<?php echo $value ?>
					</li>
					<?php } ?>

					<li>
						<textarea id="cause" name="cause" class="cause"><?php echo $model->cause ?></textarea>
					</li>

            <li class="yanzhengma clearfix" id="verifytip"> <div style="float:left" id="verifyinput">
              <input width="30px" id="verifycode" name="code" tabindex="3" class="input_txt" type="text" value="" onfocus="$('#verifycodehint').hide();" onblur="if($('#verifycode').val()=='')$('#verifycodehint').show();" placeholder="请输入验证码" />
              </div>
              <div class="yanzhengma_box">
              <?php $this->widget('CCaptcha',array('showRefreshButton'=>false,'clickableImage'=>true,)); ?>
              </div>
            </li>


				</ul>
				<input id="submit" class="bg_pink btn" type="submit" value="提交">
			<?php $this->endWidget(); ?>
    	</div>
    </div>
    <div class="col-md-4 right_banner">
    	<div class="">
    		<p class="big_font pink">
    			举报有积分
			</p>
			<p>
    			待审核人员审核举报情况属实，即可获得
			</p>
			<p class="pink">
				5个奖励积分
			</p>
			
			<img alt="" src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/report.jpg">
    	</div>
    </div>
    <div class="clear"></div>
    

    <div class="col-md-4 success_page" id="success_page" style="display:none">
    	<div class="success_content">
    		<div class="img">
    			<img alt="" src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/report_success.png">
    		</div>
	    	
	    	<div class="content">
		    	<p>感谢您的举报，待我们核实后，</p>
		    	<p>将赠送 <span class="pink">10个积分</span>做为奖励！</p>
	    	</div>
    	</div>
    </div>
    
    
</div>

<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/ajaxForm.js"></script>
<link rel="stylesheet" href="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/css/ui-dialog.css">
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/js/dialog-min.js"></script>

<script type="text/javascript">
	var D = 0;
	var IT = '';
	$('#SubmitForm').ajaxForm({
		dataType:'json',
		beforeSubmit:function(data, obj, es){
			if($("input:checked").length <= 0)
			{
	            tips = dialog({
	                fixed: true,
	                title: '系统提示',
	                content: '请选择举报原因',
	                cancelDisplay: false
	            }).showModal();	
				return false;
			}

            tips = dialog({
                fixed: true,
                title: '提交中...',
                cancelDisplay: false
            }).showModal();			
			
            return true;			
		},
		success:function(data){	
			$("#success_page").hide();		
			if(data.status)
			{
				tips.close();	

				//tips.content($("#success_page").html());	
				$("#success_page").show();
				IT = setInterval("begin();",1000);
			}else
			{
				tips.title('系统提示');
				tips.content(data.info);				
			}
		}
	});
	function begin()
	{
		if(D == 0)
		{
			D = 1;
			return;
		}else
		{
			$("#success_page").hide();
			window.location.href = "<?php echo $this->createUrl('/index') ?>";
			clearInterval(IT);
		}
	}

</script>